//
//  XDropMenuView.h
//  
//
//  Created by Veer on 17/7/10.
//  Copyright © 2017年 Veer. All rights reserved.
//  下拉列表封装view

#import <UIKit/UIKit.h>

//定义数据模型
@interface XMenuModel : NSObject

@property (nonatomic,copy) NSString *id;
@property (nonatomic,copy) NSString *name;
@property (nonatomic,copy) NSString *imageName;
@property BOOL isSub;
@property BOOL isSelect;
@end


//自定义下拉cell
@interface XMenuCell : UITableViewCell

@end


@class XDropMenuView;
@protocol XDropMenuViewDelegate <NSObject>

@optional
- (void)dropMenuView:(XDropMenuView *)dropMenuView didSelectRowAtColum:(NSInteger)colum Row:(NSInteger)row model:(XMenuModel *)model;
- (void)dropMenuView:(XDropMenuView *)dropMenuView didSelectColum:(NSInteger)colum;


@end

@interface XDropMenuView : UIView <UITableViewDataSource, UITableViewDelegate>


// 样式
@property (nonatomic, strong) UIColor *titleNormalColor;
@property (nonatomic, strong) UIColor *titleSelectedColor;
@property (nonatomic, strong) UIColor *itemNormalColor;
@property (nonatomic, strong) UIColor *itemSelectedColor;
@property (nonatomic, copy) NSString *buttonNormalImage;
@property (nonatomic, copy) NSString *buttonSelectedImage;

/** title字体大小 */
@property (nonatomic, assign) NSInteger fonteSize;
@property (nonatomic, assign) NSInteger leftMargin;


/** 设置第几项不展示文字 */
@property (nonatomic, assign) NSInteger notShowTitleColum;


@property (nonatomic, retain) NSMutableArray *AllDataArr;
@property (nonatomic, retain) NSMutableArray *showArr;
@property (nonatomic, weak) id<XDropMenuViewDelegate> delegate;

- (instancetype)initWithFrame:(CGRect)frame showOnView:(UIView*)view AllDataArr:(NSMutableArray*)arr showArr:(NSMutableArray *)showArr;

- (void)setupWithShowOnView:(UIView*)view AllDataArr:(NSMutableArray*)arr showArr:(NSMutableArray *)showArr;
/** 使某列某行被选中,默认均选中第0行。 可调用此方法更改默认。 */
- (void)selectClum:(NSInteger)colum Row:(NSInteger)row;
- (void)refreshData:(NSMutableArray *)allDataArray;


@end



